{% load i18n static %}

{% if cl.search_fields %}
  <div id="toolbar">
    <form id="changelist-search" method="get">
      <div>
        <a-divider dashed>
          <span>
            {% blocktrans with counter=cl.result_count %}
              Result: {{ counter }}
            {% endblocktrans %}
          </span>
          <a-divider type="vertical"></a-divider>
          <span>
            <a href="">
              {% if cl.show_full_result_count %}
                {% blocktrans with full_result_count=cl.full_result_count %}
                  Total: {{ full_result_count }}
                {% endblocktrans %}
              {% else %}
                {% trans "Show all" %}
              {% endif %}
            </a>
          </span>
        </a-divider>

        <a-input-search placeholder="{{ search_placeholder }}" name="{{ search_var }}" default-value="{{ search_value }}">
          <a-button html-type="submit" type="primary" slot="enterButton">{% trans 'Search' %}</a-button>
        </a-input-search>
        {% for pair in cl.params.items %}
          {% if pair.0 != search_var %}
            <input type="hidden" name="{{ pair.0 }}" value="{{ pair.1 }}">
          {% endif %}
        {% endfor %}
      </div>
    </form>
  </div>
{% endif %}
